<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import {getToken} from "@/utils/auth";

export default  {
  name:  'App',
  data() {
    return {
      cookietoken:"init"
    };
  },
  methods: {
    consoleTkent(){
      this.cookietoken=getToken();
    },
  },
  watch: {
    'cookietoken':{
      handler(newValue,oldvalue){
        if(newValue!=oldvalue&&"init"!=oldvalue){
          location.reload();
        }
      }
    }
  },
  created() {
    this.timer = setInterval(this.consoleTkent, 1000);
  }
  ,metaInfo() {
      return {
          title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
          titleTemplate: title => {
              return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
          }
      }
  }
}
</script>
<style>
  .colorfont .el-dialog {
    margin-top: 0!important;
    top: 50%!important;
    transform: translateY(-50%)!important;
  }
  .banner .el-upload-list--picture-card .el-upload-list__item {
    overflow: visible!important;
    height: 220px!important;
    border: 0;
  }
</style>
